home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Deutsche Edition 1
/
Deutsche Edition 1.iso
/
amok
/
amok_lha
/
amok15.lha
/
Calc
/
Calc.mod
< prev
next >
Wrap
Text File
|
1993-08-15
|
1KB
|
46 lines
MODULE Calc;
FROM Arts IMPORT dosCmdBuf, wbStarted;
FROM FormelAuswertung IMPORT Formelstring, DefFormel, LongBerechnung;
FROM Terminal IMPORT WriteString, WriteLn;
FROM MyLongRealConversions IMPORT RealToStr;
FROM Strings IMPORT Length;
VAR
formel: POINTER TO Formelstring;
x: LONGREAL;
i,j: CARDINAL;
s: Formelstring;
BEGIN
IF (dosCmdBuf#NIL) AND NOT(wbStarted) THEN
formel := dosCmdBuf;
i := 0; j := 0;
WHILE (formel^[i]#0C) AND (formel^[i]#12C) AND (i<255) DO
IF formel^[i]#" " THEN
s[j] := formel^[i];
INC(j);
END;
INC(i);
END;
s[j] := 0C;
CASE DefFormel(1,s,TRUE,TRUE) OF
31: WriteString("Keine Formel!") |
32: WriteString("Variablen in Formel nicht erlaubt!") |
33: WriteString("Syntaxfehler!") |
34: WriteString("Formel enthält ungültiges Zeichen!") |
35: WriteString("Zahl zu groß!") |
ELSE
LongBerechnung(1,x,i);
IF i=0 THEN
RealToStr(x,s,10,10);
WriteString(s);
ELSE
WriteString("Fehler!");
END;
END;
END;
WriteLn;
END Calc.